﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _2008A.PH5._0221_0317.FuXi.Domain
{
    /// <summary>
    /// 产品表
    /// </summary>
    [Table("tb_product")]
    public class ProductEntity : AuditField
    {
        public string? Title { get; set; } //标题
        public string? CoverImage { get; set; } //封面图片

        public decimal Price { get; set; } //价格
        public int Stock { get; set; }  //库存数量
        public int SaleNumber { get; set; } //销售数量
        //public string Color { get; set; }
        //public string Size { get; set; }

        public string? Spec { get; set; } //规格  {"颜色":"红色","内存":"256G","屏幕":"4.6寸"}

        public Guid? CategoryId { get; set; } //分类
        public Guid? BrandId { get; set; } //品牌
        public string? Flag { get; set; } = "000000"; //扩展标记位 
        public Guid? StoreId { get; set; } //店铺ID
        public string? StoreName { get; set; } //店铺名称
        public string? IsUp { get; set; } = "1";//是否上架，默认1表示 是，0为否

        
        //==========导航属性============
        public List<ProductImageEntity>? ProductImages { get; set; } //一个商品，对应多个图片 
    }

    /// <summary>
    /// 产品图片表
    /// </summary>
    [Table("tb_product_image")]
    public class ProductImageEntity : AuditField
    {
        public Guid ProductId { get; set; }
        public string ImagePath { get; set; }
    }
}
